package b3.widget.mail
{
	import b3.net.ResourceHelper;
	import b3.widget.WidgetManager;
	import b3.widget.basic.BasicIcon;
	import b3.widget.warehouse.*;
	
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class MailReceiveIcon extends BasicIcon
	{
		public function MailReceiveIcon()
		{
			var IconImg:Class = ResourceHelper.getInstance().getClassByName("MailIcon");
			super(IconImg);
			this.addEventListener(MouseEvent.CLICK, onMouseClick);
		}
		
		private function onMouseClick(event:Event):void
		{
			var warehouse:Warehouse = Warehouse.getInstance();
			warehouse.x = -warehouse.width / 2;
			warehouse.y = -warehouse.height / 2;
			warehouse.selectTab(2);
			WidgetManager.getInstance().popOut([warehouse], true);
		}
		
	}
}